using UnityEngine;

namespace Crosstales.UI
{
    // [Assembly-CSharp-firstpass.dll].Crosstales.UI.UIResize
    public class UIResize : MonoBehaviour, IPointerDownHandler, IEventSystemHandler, IDragHandler
    {
        // Fields
        public UnityEngine.Vector2 MinSize;
        public UnityEngine.Vector2 MaxSize;
        public bool IgnoreMaxSize;
        public float SpeedFactor;
        private UnityEngine.RectTransform panelRectTransform;
        private UnityEngine.Vector2 originalLocalPointerPosition;
        private UnityEngine.Vector2 originalSizeDelta;
        private UnityEngine.Vector2 originalSize;
        
        // Methods
        private void Awake()
        {
            this.panelRectTransform = this.transform.parent.GetComponent<System.Object>();
            UnityEngine.Rect val_4 = this.panelRectTransform.rect;
            this.originalSize = val_4.m_XMin.width;
            mem[1152921504930430476] = val_4.m_XMin.height;
        }
        public void OnPointerDown(UnityEngine.EventSystems.PointerEventData data)
        {
            UnityEngine.Vector2 val_1 = this.panelRectTransform.sizeDelta;
            this.originalSizeDelta = new UnityEngine.Vector2();
            mem[1152921504930430468] = ???;
            UnityEngine.Camera val_2 = data.pressEventCamera;
            bool val_3 = UnityEngine.RectTransformUtility.ScreenPointToLocalPointInRectangle(rect:  this.panelRectTransform, screenPoint:  new UnityEngine.Vector2(), cam:  this.originalLocalPointerPosition, localPoint:  new UnityEngine.Vector2() {x = data._position_k__BackingField, y = V9.16B});
        }
        public void OnDrag(UnityEngine.EventSystems.PointerEventData data)
        {
            UnityEngine.EventSystems.PointerEventData val_12 = data;
            if(this.panelRectTransform == 0)
            {
                    return;
            }
            
            val_12 = val_12.pressEventCamera;
            bool val_3 = UnityEngine.RectTransformUtility.ScreenPointToLocalPointInRectangle(rect:  this.panelRectTransform, screenPoint:  new UnityEngine.Vector2(), cam:  0, localPoint:  new UnityEngine.Vector2() {x = data._position_k__BackingField, y = V9.16B});
            float val_12 = 0f;
            float val_13 = 0f;
            val_12 = val_12 - this.originalLocalPointerPosition;
            UnityEngine.Vector2 val_14 = this.originalSizeDelta;
            val_13 = val_13 - S5;
            val_12 = val_12 * this.SpeedFactor;
            val_14 = this.originalSize + (val_14 + val_12);
            if(val_14 < 0)
            {
                    float val_7 = this.originalSize - this.MinSize;
            }
            else
            {
                    if((this.IgnoreMaxSize != true) && (val_14 > this.MaxSize))
            {
                    float val_8 = this.MaxSize - this.originalSize;
            }
            
            }
            
            float val_9 = (this.SpeedFactor - (val_13 * this.SpeedFactor)) + this.originalSize;
            if(val_9 < 0)
            {
                    float val_10 = this.originalSize - this.MaxSize;
            }
            else
            {
                    if((this.IgnoreMaxSize != true) && (val_9 > this.MaxSize))
            {
                    float val_11 = this.MaxSize - this.originalSize;
            }
            
            }
            
            this.panelRectTransform.sizeDelta = new UnityEngine.Vector2();
        }
        public UIResize()
        {
            this.SpeedFactor = 2f;
            this.MinSize = ;
        }
    
    }

}
